<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	request.setAttribute("basePath", basePath);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="<%=basePath%>css/easyui.css">
<link rel="stylesheet" type="text/css" href="<%=basePath%>css/icon.css">
<link rel="stylesheet" type="text/css" href="<%=basePath%>css/demo.css">
<script type="text/javascript" src="<%=basePath%>js/jquery.min.js"></script>
<script type="text/javascript" src="<%=basePath%>js/jquery.easyui.min.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>更改公告</title>
<script type="text/javascript">
	$(document).ready(function() {
		/* $('#w').window('close');
		$('#t1').datagrid({ onClickRow:
            function () {
                //单击行的时候，将单选按钮设置为选中
                var id = $('#t1').datagrid("getSelected");
                $("input[name='name']").each(function () {
                    if ($(this).val() == id.Id) {
                        $(this).attr("checked", true);
                    }
                });
            }
        }); */
		$('#changeNotice').click(function(){
			var rowServers = getSelectedServers();
		  	if(rowServers.length==0 || rowServers.length==0){
			  	return;
		  	}
			var requestParams="{\"servers\":";
			requestParams += "["
			  $.each(rowServers, function(index, value){
				  requestParams += "{\"tag\"" + ":\"" + value['serverId'] + '_' + value['serverName'] + "\"},";			                     
			  });
			  requestParams = requestParams.substring(0, requestParams.length - 1);
			  requestParams += "]";
			  requestParams += "}";
			  var url = "ChangeNoticeServlet?paras=" + requestParams; 
			  $.post(url, function(data){
				  $('#w').window('open');
				  $('#w').html(data);
			  });
		});
	});
</script>
</head>
<body class="easyui-layout">
	<div data-options="region:'north',border:false"
		style="height: 60px; background: #B3DFDA; padding: 10px"></div>
	<div data-options="region:'west',split:true,title:' '"
		style="width: 20%; padding: 10px;">
		<ul type="none">
			<c:forEach var="gmComm" items="${gmComms}">
				<li><a href="ToGMFunctionServlet?tag=${gmComm.tag}"
					class="easyui-linkbutton">${gmComm.gmName}</a></li>
			</c:forEach>
		</ul>
	</div>
	<div data-options="region:'center',title:' '" style="width: 80%">
		<jsp:include page="gmServers.jsp" />
		<!-- <form id="chooseGMServer" action="#" method="post"
			entyctype="text/plain">
			<table id="t1" title="选择需要更新的服务器" style="width: 100%; height: 300px"
				data-options="rownumbers:true,singleSelect:true,autoRowHeight:true,pagination:true,pageSize:10,url:'GetGMServersServlet',method:'get',singleSelect:true">
				<thead>
					<tr>
						<th data-options="field:'ck',checkbox:true"></th>
						<th data-options="field:'serverId',width:50">id</th>
						<th data-options="field:'serverName',width:80">服务器名</th>
					</tr>
				</thead>
			</table>
		</form> -->
		<div class="easyui-panel" title="" style="width: 400px">
			<div style="padding: 10px 60px 20px 60px">
				<form id="ff" method="post" action="queryEmail">
					<table cellpadding="5">
						<tr>
							<td><a type="button" id="changeNotice"
								class="easyui-linkbutton">更改公告,让它生效</a></td>
						</tr>
					</table>
				</form>
			</div>
		</div>
	</div>
	<div id="w" class="easyui-window" title="Basic Window"
		data-options="iconCls:'icon-save'"
		style="width: 500px; height: 200px; padding: 10px;" maximized="true"
		collapsible="false" minimizable="false">The window content.</div>
</body>
</html>